package org.snia.cdmi.model;

import java.io.InputStream;

public class DataObject extends MetaDataObject {

	private static final long serialVersionUID = -2883501141593631181L;

	/** The stream containing the contents of this object from System */
	private InputStream objectContent;
	private String mimetype;

	public String getMimetype() {
		return mimetype;
	}

	public void setMimetype(String mimetype) {
		this.mimetype = mimetype;
	}

	public void setObjectContent(InputStream objectContent) {
		this.objectContent = objectContent;
	}

	/**
	 * Gets an input stream containing the contents of this object. Callers
	 * should close this input stream as soon as possible, because the object
	 * contents aren't buffered in memory and stream directly from Amazon S3.
	 * 
	 * @return An input stream containing the contents of this object.
	 * 
	 * @see S3Object#getObjectMetadata()
	 * @see S3Object#setObjectContent(InputStream)
	 */
	public InputStream getContent() {
		return objectContent;
	}

	/**
	 * Sets the input stream containing this object's contents.
	 * 
	 * @param objectContent
	 *            The input stream containing this object's contents.
	 * 
	 * @see S3Object#getObjectContent()
	 */
	public void setContent(InputStream objectContent) {
		this.objectContent = objectContent;
	}

	/**
	 * @see java.lang.Object#toString()
	 */
	@Override
	public String toString() {
		return super.toString();
	}
}
